package com.study.spmongodb.book.wwj.char05;

/**
 * @author MI
 * @version 1.0
 * @date 2020/11/25 21:31
 */
public class ThreadGroupCreator {
    public static void main(String[] args) {
        //获取当前线程的 group
        final ThreadGroup currentGroup = Thread.currentThread().getThreadGroup();
        final ThreadGroup group1 = new ThreadGroup("Group1");

        System.out.println(group1.getParent() == currentGroup);

        final ThreadGroup group2 = new ThreadGroup(group1, "Group2");
        System.out.println(group2.getParent() == group1);
    }
}
